3.197 \(\int \frac{\cos (x)}{\sec (x)-\tan (x)} \, dx\)

Optimal. Leaf size=6 \[ x-\cos (x) \]

[Out]

x - Cos[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0600477, antiderivative size = 6, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {4391, 2682, 8} \[ x-\cos (x) \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]/(Sec[x] - Tan[x]),x]

[Out]

x - Cos[x]

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2682

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(g*(g*Cos[e
 + f*x])^(p - 1))/(b*f*(p - 1)), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cos (x)}{\sec (x)-\tan (x)} \, dx &=\int \frac{\cos ^2(x)}{1-\sin (x)} \, dx\\ &=-\cos (x)+\int 1 \, dx\\ &=x-\cos (x)\\ \end{align*}

Mathematica [A]  time = 0.0214677, size = 6, normalized size = 1. \[ x-\cos (x) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/(Sec[x] - Tan[x]),x]

[Out]

x - Cos[x]

________________________________________________________________________________________

Maple [B]  time = 0.099, size = 15, normalized size = 2.5 \begin{align*} -2\, \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{-1}+x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(sec(x)-tan(x)),x)

[Out]

-2/(tan(1/2*x)^2+1)+x

________________________________________________________________________________________

Maxima [B]  time = 1.48269, size = 41, normalized size = 6.83 \begin{align*} -\frac{2}{\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1} + 2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(sec(x)-tan(x)),x, algorithm="maxima")

[Out]

-2/(sin(x)^2/(cos(x) + 1)^2 + 1) + 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

Fricas [A]  time = 0.470495, size = 16, normalized size = 2.67 \begin{align*} x - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(sec(x)-tan(x)),x, algorithm="fricas")

[Out]

x - cos(x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos{\left (x \right )}}{- \tan{\left (x \right )} + \sec{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(sec(x)-tan(x)),x)

[Out]

Integral(cos(x)/(-tan(x) + sec(x)), x)

________________________________________________________________________________________

Giac [B]  time = 1.12075, size = 19, normalized size = 3.17 \begin{align*} x - \frac{2}{\tan \left (\frac{1}{2} \, x\right )^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(sec(x)-tan(x)),x, algorithm="giac")

[Out]

x - 2/(tan(1/2*x)^2 + 1)